package com.shbt.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_user", catalog = "default_schema")
public class TUser implements java.io.Serializable {

	// Fields

	private Integer id;
	private TProfessional TProfessional;
	private String userCode;
	private String nickName;
	private String password;
	private Boolean gender;
	private String address;
	private Date signTime;
	private Date birthday;
	private String grade;
	private String collegeName;
	private String universityName;
	private String backmark;
	private String telphone;
	private String photo;
	private Set<TAuthorization> TAuthorizations = new HashSet<TAuthorization>(0);
	private Set<TReleaseSell> TReleaseSells = new HashSet<TReleaseSell>(0);

	// Constructors

	/** default constructor */
	public TUser() {
	}

	/** minimal constructor */
	public TUser(Integer id, TProfessional TProfessional) {
		this.id = id;
		this.TProfessional = TProfessional;
	}

	/** full constructor */
	public TUser(Integer id, TProfessional TProfessional, String userCode,
			String nickName, String password, Boolean gender, String address,
			Date signTime, Date birthday, String grade, String collegeName,
			String universityName, String backmark, String telphone,
			String photo, Set<TAuthorization> TAuthorizations,
			Set<TReleaseSell> TReleaseSells) {
		this.id = id;
		this.TProfessional = TProfessional;
		this.userCode = userCode;
		this.nickName = nickName;
		this.password = password;
		this.gender = gender;
		this.address = address;
		this.signTime = signTime;
		this.birthday = birthday;
		this.grade = grade;
		this.collegeName = collegeName;
		this.universityName = universityName;
		this.backmark = backmark;
		this.telphone = telphone;
		this.photo = photo;
		this.TAuthorizations = TAuthorizations;
		this.TReleaseSells = TReleaseSells;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_professional_id", nullable = false)
	public TProfessional getTProfessional() {
		return this.TProfessional;
	}

	public void setTProfessional(TProfessional TProfessional) {
		this.TProfessional = TProfessional;
	}

	@Column(name = "user_code", length = 20)
	public String getUserCode() {
		return this.userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	@Column(name = "nick_name", length = 20)
	public String getNickName() {
		return this.nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Column(name = "password", length = 16)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "gender")
	public Boolean getGender() {
		return this.gender;
	}

	public void setGender(Boolean gender) {
		this.gender = gender;
	}

	@Column(name = "address", length = 100)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sign_time", length = 10)
	public Date getSignTime() {
		return this.signTime;
	}

	public void setSignTime(Date signTime) {
		this.signTime = signTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birthday", length = 10)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "grade", length = 20)
	public String getGrade() {
		return this.grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	@Column(name = "college_name", length = 20)
	public String getCollegeName() {
		return this.collegeName;
	}

	public void setCollegeName(String collegeName) {
		this.collegeName = collegeName;
	}

	@Column(name = "university_name", length = 20)
	public String getUniversityName() {
		return this.universityName;
	}

	public void setUniversityName(String universityName) {
		this.universityName = universityName;
	}

	@Column(name = "backmark", length = 65535)
	public String getBackmark() {
		return this.backmark;
	}

	public void setBackmark(String backmark) {
		this.backmark = backmark;
	}

	@Column(name = "telphone", length = 11)
	public String getTelphone() {
		return this.telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	@Column(name = "photo", length = 100)
	public String getPhoto() {
		return this.photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TUser")
	public Set<TAuthorization> getTAuthorizations() {
		return this.TAuthorizations;
	}

	public void setTAuthorizations(Set<TAuthorization> TAuthorizations) {
		this.TAuthorizations = TAuthorizations;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TUser")
	public Set<TReleaseSell> getTReleaseSells() {
		return this.TReleaseSells;
	}

	public void setTReleaseSells(Set<TReleaseSell> TReleaseSells) {
		this.TReleaseSells = TReleaseSells;
	}

}